<template>
  <div class="main_box" style="padding:10px;">
    <div class="detail_wrap">
      <div class="tit">
        <h2>医 院 项 目 组 信 息</h2>
        <el-button
          type="success"
          plain
          size="small"
          icon="fa fa-mail-forward"
          @click="returnList"
        >
          返 回</el-button
        >
      </div>
      <div class="con">
        <ul>
          <li>
            <label class="label">项目组编号:</label>
            <span>{{ dataInfo.itemCode }}</span>
          </li>
          <li>
            <label class="label">项目组名称:</label>
            <span>{{ dataInfo.itemName }}</span>
          </li>
          <li>
            <label class="label">项目组别称:</label>
            <span>{{ dataInfo.itemShortName }}</span>
          </li>
          <li>
            <label class="label">医院名称:</label>
            <span>{{ dataInfo.hospitalName }}</span>
          </li>
          <li>
            <label class="label">价格模板名称:</label>
            <span>{{ dataInfo.modelName||'暂无' }}</span>
          </li>
          <li>
            <label class="label">对应康来项目名:</label>
            <span>{{ dataInfo.reportItemName }}</span>
          </li>
          <li>
            <label class="label">原价格:</label>
            <span>{{ dataInfo.itemPrice | filterPrice }}</span>
          </li>
          <li>
            <label class="label">合作价格:</label>
            <span>{{ dataInfo.itemSalePrice | filterPrice }}</span>
          </li>
          <li>
            <label class="label">临床意义:</label>
            <span>{{ dataInfo.itemMeaning }}</span>
          </li>
          <li>
            <label class="label">注意事项:</label>
            <span>{{ dataInfo.itemNote }}</span>
          </li>
          <li>
            <label class="label">创建人名称:</label>
            <span>{{ dataInfo.createUserName }}</span>
          </li>
          <li>
            <label class="label">创建时间:</label>
            <span>{{ dataInfo.createDate }}</span>
          </li>
        </ul>
      </div>
      <div class="tit">
        <h2>医 检 项 目 列 表</h2>
      </div>
      <el-table
        :data="tableData2"
        highlight-current-row
        :header-cell-style="{'background-color':'#f2f2f2'}"
        style="width: min-content;margin: 20px 0;">
        <el-table-column type="index" width="80px" align="center" label="序号">

        </el-table-column>
        <el-table-column prop="institutionName" label="医检名称" width="180px" align="center">

        </el-table-column>
        <el-table-column prop="insItemName" label="项目名称" width="180px" align="center">

        </el-table-column>
        <el-table-column prop="insItemMethodology" label="方法学" width="180px" align="center">

        </el-table-column>
        <el-table-column prop="insItemPrice" label="医检原价(元)" width="180px" align="center">

        </el-table-column>
        <el-table-column prop="insItemSalePrice" label="医检合作价(元)" width="180px" align="center">

        </el-table-column>
        <!-- <el-table-column prop="" label="康来价格(元)" width="180px" align="center">
          <template slot-scope="{row}">
            <div>

            </div>
          </template>
        </el-table-column> -->
        <el-table-column prop="hosItemPrice" label="医院原价(元)" width="180px" align="center">

        </el-table-column>
        <el-table-column prop="hosItemSalePrice" label="医院合作价(元)" width="180px" align="center">

        </el-table-column>
      </el-table>
      <div class="tit">
        <h2>关 联 医 院 子 项 目 列 表</h2>
      </div>
      <el-table
        :data="tableData"
        highlight-current-row
        :header-cell-style="{'background-color':'#f2f2f2'}"
        style="width: min-content;margin: 20px 0;">
        <el-table-column type="index" width="80px" align="center" label="序号">

        </el-table-column>
        <el-table-column prop="subItemId" label="子项目ID" width="180px" align="center">

        </el-table-column>
        <el-table-column prop="subItemCode" label="子项目编号" width="180px" align="center">

        </el-table-column>
        <el-table-column prop="subItemName" label="子项目名称" width="300px" align="center">

        </el-table-column>
        <el-table-column prop="subItemShortName" label="子项目别称" width="180px" align="center">

        </el-table-column>
      </el-table>
      <!-- <div class="tit">
        <h2>康 来 项 目 列 表</h2>
      </div>
      <el-table
        :data="tableData"
        highlight-current-row
        :header-cell-style="{'background-color':'#f2f2f2'}"
        style="width: min-content;margin: 20px 0;">
        <el-table-column type="index" width="80px" align="center" label="序号">

        </el-table-column>
        <el-table-column prop="itemName" label="项目名" width="180px" align="center">

        </el-table-column>
        <el-table-column label="省市" width="200px" align="center">
          <template slot-scope="{row:{provinceName,cityName}}">
            <div>
              {{ provinceName+(cityName?cityName:'') }}
            </div>
          </template>
        </el-table-column>
        <el-table-column prop="feeLevel" label="收费级别" width="200px" align="center">

        </el-table-column>
        <el-table-column prop="methodology" label="方法学" width="200px" align="center">

        </el-table-column>
        <el-table-column prop="itemPrice" label="价格(元)" width="140px" align="center">

        </el-table-column>
      </el-table> -->

    </div>
  </div>
</template>

<script>
import HospitalApi from "@/api/institution/hospitalItem";
export default {
  data() {
    return {
      dataInfo: {},
      tableData: [],
      tableData2:[],
    };
  },
  methods: {
    getData() {
      HospitalApi.getHospitalItem({ itemId: this.$route.query.id }).then(
        res => {
          this.dataInfo = res.data;
          this.tableData = res.data.hospitalSubItems
          this.tableData2 = res.data.hosItemIns
        }
      );
    },
    returnList() {
      this.$store.dispatch("delView", this.$route);
      // this.$router.push('/items/hospitalItemManagement')
      this.$router.go(-1);
      // 需要保持原有的页面
    }
  },
  mounted() {
    this.getData();
  },
  filters: {
    //   过滤器
    filterTime(value) {
      if (value) {
        return value + "h";
      } else {
        return "未知";
      }
    },
    filterPrice(value) {
      if (value) {
        return value + "元";
      } else {
        return "未知";
      }
    }
  }
};
</script>
<style lang="scss" src="@/assets/css/views/Detail.scss" scope></style>
